﻿@model ListViewModel<CommonSearchValues, IQueryable<UserMemo>>
@{
    ViewBag.Title = "健康备忘录";
}
@using (Ajax.BeginForm(null, new { IsView = false }, new AjaxOptions { HttpMethod = "Post", LoadingElementId = "OnLoadingSpan", UpdateTargetId = "main", OnFailure = "OnSiteError" }))
{
    <fieldset class="toolbox">
        <legend>
            <div class="catalog-title icons icons-add">
                健康备忘录&nbsp;&nbsp;
@*                @Ajax.ActionLink("记录备忘录...", "UserMemoEdit", new { }, new AjaxOptions() { LoadingElementId = "OnLoadingSpan", UpdateTargetId = "dialogbox", OnComplete = "showDialog('健康备忘录');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
*@            </div>
        </legend>
        @Html.HiddenFor(m => Model.PageSize)
        <input type="hidden" name="PageIdx" id="qspidx" value="0" />
        患者:@Html.TextBoxFor(m => m.SearchFrom.V0)
        内容:@Html.TextBoxFor(m => m.SearchFrom.V1)
        记录时间：@Html.EditorFor(m => m.SearchFrom.V2, "DateTimeStr")
        至：@Html.EditorFor(m => m.SearchTo.V2, "DateTimeStr")
        @Helpers.SubmitButton("查询", "qssubmit")
    </fieldset>
}
<table class="width">
    <tr>
        <th>患者</th>
        <th>
            标题
        </th>
@*        <th>
            共享医院
        </th>*@
        <th>
            备注内容
        </th>
        <th>
            图片内容
        </th>
        <th>
            记录时间
        </th>
                <th>
            创建时间
        </th>
        <th>
        </th>
    </tr>
    @{int dColor = 0;}
    @foreach (var item in Model.Data)
    {
        <tr class="tr-backColor@(dColor++ % 2)">
            <td>@Html.DisplayFor(model=>item.aspnet_Users.UserName)</td>
            <td>@Html.FixStrSuffix(item.Title, 24)
            </td>
@*            <td nowrap="nowrap">@(item.Recuper == null ? string.Empty : (string.Format("{0} {1} {2} {3} {4}",item.Recuper.Hospital.HospCode + item.Recuper.BingQu.Title + item.Recuper.Department.DepName + item.Recuper.Doctor.UserName + " " + item.Recuper.EnHospDay.ToString("yyyy年M月"))))
            </td>*@
            <td title="@item.MemoText">@Html.FixStrSuffix(item.MemoText, 32)
            </td>
            <td nowrap="nowrap"  width="48px">
                @if (!string.IsNullOrEmpty(item.MemoPic))
                {

                    <div class="previewbtn">
                        <a target="_blank" class=" ui-icon ui-icon-image" style="float:left;" href="@(Url.Action("Img", "Recuper", new { ID = item.MemoPic}))" title="查看" >
                        </a><a class=""  target="_blank" href="@(Url.Action("Img", "Recuper", new { ID = item.MemoPic }))"  >
                            查看</a>
                    </div>
                }
            </td>
            <td nowrap="nowrap" >@Helpers.DateTimeString(item.Timemark,"yyyy-MM-dd")</td>
            <td nowrap="nowrap" >@Helpers.DateTimeString(item.CreateTime,"yyyy-MM-dd HH:mm")</td>
            
            <td nowrap="nowrap">
                @Ajax.ActionLink("查看", "UserMemoEdit", new { id = item.ID }, new AjaxOptions() { LoadingElementId = "OnLoadingSpan", UpdateTargetId = "dialogbox", OnComplete = "showDialog('健康备忘录');", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, OnFailure = "OnSiteError" })
            </td>
        </tr>
    }
</table>
@Html.Partial("Pagger", new PaggerViewModel { Act = "SentSms", PageIdx = Model.PageIdx, PageCount = Model.PageCount, ItemCount = Model.ItemCount })
@Html.Partial("TrHilighter")
<script type="text/javascript">
    $(function () {
        $(".previewbtn").tooltip({
            items:"a",
            content: function () {
                var element = $(this);
                var src = element.attr("href");
                return "<img  class='imgpreview' alt='预览' src='" + src + "?Preview=true'>";
            }
        });
    });
</script>
